Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop Modal Experiment #11484

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

Desktop Modal Experiment #11484

wants to merge 28 commits into from

Conversation

abergs
Copy link
Member

@abergs abergs commented Oct 10, 2024

Tracking

https://bitwarden.atlassian.net/browse/PM-14223

📔 Objective

This PR aims to add a way for the desktop window to be presented in a smaller modal mode to enhance the UX for certain flows, like passkeys and SSH Agent.

Todo - but could just as well be separate PRs (are tracked in JIRA as subtasks)

  • QA: Test more on windows
  • Improvement: Add DeepLinkGuard to make sure the unlock screen forwards you to the specific route
  • Improvement: Reset route on windows close (the UI/route opened in the modal is often contextful and should not remain open if the modal is closed)

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Co-authored-by: @justindbaur

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 81 lines in your changes missing coverage. Please review.

Project coverage is 33.53%. Comparing base (997d40f) to head (8b30e71).
Report is 6 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/desktop/src/main/window.main.ts 0.00% 26 Missing ⚠️
apps/desktop/src/platform/popup-modal-styles.ts 0.00% 25 Missing ⚠️
apps/desktop/src/main/tray.main.ts 0.00% 12 Missing ⚠️
...p/src/app/components/fido2placeholder.component.ts 0.00% 8 Missing ⚠️
.../src/platform/services/desktop-settings.service.ts 0.00% 6 Missing ⚠️
apps/desktop/src/app/services/init.service.ts 0.00% 3 Missing ⚠️
apps/desktop/src/app/app-routing.module.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11484      +/-   ##
==========================================
- Coverage   33.56%   33.53%   -0.03%     
==========================================
  Files        2926     2928       +2     
  Lines       91527    91605      +78     
  Branches    17395    17412      +17     
==========================================
- Hits        30721    30720       -1     
- Misses      58392    58471      +79     
  Partials     2414     2414              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Oct 10, 2024

Logo
Checkmarx One – Scan Summary & Details23bd1463-ec51-4ad3-9a28-6269be42aab5

No New Or Fixed Issues Found

@abergs abergs force-pushed the passkey-window-creation branch from 595b431 to a09a471 Compare October 28, 2024 16:02
@abergs abergs marked this pull request as ready for review October 28, 2024 17:10
@abergs abergs requested a review from a team as a code owner October 28, 2024 17:10
@abergs abergs marked this pull request as draft October 28, 2024 17:10
@abergs abergs marked this pull request as ready for review October 28, 2024 17:41
@abergs
Copy link
Member Author

abergs commented Oct 28, 2024

Ready for first review (but waiting on builds to finish, don't know if I've broken anything in the last commits)

apps/desktop/src/app/components/passkeys.component.ts Outdated Show resolved Hide resolved
apps/desktop/src/main/window.main.ts Outdated Show resolved Hide resolved
apps/desktop/src/main/window.main.ts Show resolved Hide resolved
apps/desktop/src/main/window.main.ts Outdated Show resolved Hide resolved
apps/desktop/src/main/window.main.ts Outdated Show resolved Hide resolved
Comment on lines +74 to +76
const IN_MODAL_MODE = new KeyDefinition<boolean>(DESKTOP_SETTINGS_DISK, "inModalMode", {
deserializer: (b) => b,
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: shouldn't this be stored in memory? Disk persists across process restarts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, will do (any other opinion @justindbaur?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now this wouldn't work, memory storage isn't shared between renderer and main process right now. And I don't really want it to, at least not for this. We could maybe think about clearing it on start of the application though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that resolves this discussions, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh we need that setting to sync. Clearing it on application start should be enough, just to be safe so we don't introduce bugs if the application is force-closed in modal mode

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abergs I still think we need to clear this value on application start

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see! Newbie question: How do one go about doing that? @coroiu

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait - since the app can/should launch into modal mode, it's important we don't clear it and automatically throw the user out of modal mode. Perhaps that's not an issue, I don't know the implementation too well.

apps/desktop/src/app/components/passkeys.component.ts Outdated Show resolved Hide resolved
apps/desktop/src/platform/popup-modal-styles.ts Outdated Show resolved Hide resolved
apps/desktop/src/main/window.main.ts Outdated Show resolved Hide resolved
@abergs abergs requested a review from coroiu November 13, 2024 14:39
Copy link
Contributor

@coroiu coroiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good except that last remaining thread, we need to clear the value on application start so that a crash doesn't brick the application

Comment on lines +74 to +76
const IN_MODAL_MODE = new KeyDefinition<boolean>(DESKTOP_SETTINGS_DISK, "inModalMode", {
deserializer: (b) => b,
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abergs I still think we need to clear this value on application start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants